import 'package:flutter/material.dart';
import 'package:test/utiles/UtilView.dart';

class StackView extends StatelessWidget {
  const StackView({super.key});

  @override
  Widget build(BuildContext context) {
    Widget yellowBox = Container(color: Colors.yellow, height: 100, width: 100);
    Widget redBox = Container(color: Colors.red, height: 90, width: 90);
    Widget greenBox = Container(color: Colors.green, height: 80, width: 80);
    Widget cyanBox = Container(color: Colors.cyanAccent, height: 70, width: 70);
    Widget deepBox = Container(color: Colors.deepPurple, height: 50, width: 50);
    return Scaffold(
      body: Container(
        color: Colors.deepOrangeAccent,
        width: double.infinity,
        height: double.infinity,
        child: Align(
          alignment: Alignment.center,
          child: Column(
            children: [
              UtilView.getTitle("Stack"),
              Container(
                color: Colors.black12,
                width: 300,
                height: 150,
                alignment: Alignment.topRight,
                child: Stack(children: [yellowBox, redBox, greenBox, cyanBox]),
              ),
              UtilView.getTitle("Positioned"),
              Container(
                color: Colors.black12,
                width: 300,
                height: 100,
                child: Stack(
                  children: [
                    yellowBox,
                    redBox,
                    greenBox,
                    cyanBox,
                    Positioned(bottom: 10, right: 10, child: deepBox),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }

}
